package cn.tedu.fz;

public class Person {
    private String name;
    private int age;
    private double money;
    public Person(){}
    public Person(String name, int age, double money) {
        this.name = name;
        this.age = age;
        this.money = money;
    }
    //设置money的值
    public void setMoney(double money){
        //调用当前方法的人进行身份校验
//        if(身份没问题){
//            this.money += money;
//        }else{
//            System.out.println("你不能操作别人的钱！");
//        }
        this.money += money;
    }
    //获取money的值
    public double getMoney(){
        return this.money;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void eat(){
        System.out.println("吃饭~~");
    }
    public void sleep(){
        System.out.println("睡觉~~");
    }

}
